/*
 * @Description: banner
 * @Author: iamsmiling
 * @Date: 2021-05-23 14:58:26
 * @LastEditTime: 2021-05-23 17:46:28
 */

import 'package:credit_business_circle/R/R.dart';
import 'package:flutter/material.dart';
// ignore: import_of_legacy_library_into_null_safe
import 'package:carousel_slider/carousel_slider.dart';

class HomeBanner extends StatelessWidget {
  final List<String> images;
  const HomeBanner({Key? key, required this.images}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ClipRRect(
      borderRadius: BorderRadius.circular(R.dimen.sp8),
      child: CarouselSlider(
        options: CarouselOptions(viewportFraction: 1, height: R.dimen.dp124),
        items: [
          for (String src in images)
            Image.network(
              src,
              width: R.dimen.width,
              fit: BoxFit.fitWidth,
            ),
        ],
      ),
    );
  }
}
